#ifndef PATIENTLISTMODEL_H
#define PATIENTLISTMODEL_H

#include <QAbstractListModel>

/*!
 * @class PatientListModel
 * @brief View model class for use with QListView that stores a list of
 *        patients.
 */

struct PatientListItem
{
    QString title;
    int userId;
};

class PatientListModel : public QAbstractListModel
{
public:
    PatientListModel();

    int rowCount(const QModelIndex &) const;
    QVariant data(const QModelIndex &index, int role) const;
    QVariant headerData(int section, Qt::Orientation orientation, int role) const;

    /* Loads list of all patients to user with specified id */
    void loadRelated(int userId);

    /* Loads list of all patients */
    void loadAll();

private:
    /* Loads list of patients from list of patient ids */
    void loadList(QList<int> * list);

    QList<PatientListItem> patientItemList;
};
#endif // PATIENTLISTMODEL_H
